<?php
/**
 * error code 说明.
 * <ul>
 *    <li>-40001: 签名验证错误</li>
 *    <li>-40002: xml解析失败</li>
 *    <li>-40003: sha加密生成签名失败</li>
 *    <li>-40004: encodingAesKey 非法</li>
 *    <li>-40005: appid 校验错误</li>
 *    <li>-40006: aes 加密失败</li>
 *    <li>-40007: aes 解密失败</li>
 *    <li>-40008: 解密后得到的buffer非法</li>
 *    <li>-40009: base64加密失败</li>
 *    <li>-40010: base64解密失败</li>
 *    <li>-40011: 生成xml失败</li>
 * </ul>
 */

namespace app\common\qwCVD;

class EventCode
{
    const EVENT = [
        'change_external_contact' => [
            'add_external_contact' => '成员添加企业客户事件',
            'edit_external_contact' => '成员编辑企业客户事件',
            'add_half_external_contact' => '企业客户添加成员事件',
            'del_external_contact' => '成员删除企业客户事件',
            'del_follow_user' => '企业客户删除成员事件',
            'transfer_fail' => '客户接替失败事件',
        ],
        'change_external_chat' => [
            'create' => '客户群创建事件',
            'update' => [
                'change_name' => '客户群名称变更事件',
                'change_notice' => '客户群公告变更事件',
                'change_owner' => '客户群群主变更事件',
                'add_member' => '客户群成员入群事件',
                'del_member' => '客户群成员退群事件',
            ],
            'dismiss' => '客户群解散事件',
        ],
        'change_external_tag' => [
            'create' => '客户标签创建事件',
            'update' => '客户标签变更事件',
            'delete' => '客户标签删除事件',
            'shuffle' => '客户标签重排事件',
        ],
        'msgaudit_notify' => '会话操作通知事件',
        'kf_msg_or_event' => '通讯录同步事件',
    ];
    
    public function __construct($key)
    {

    }
    
    public static function getEvent($event, $type=null, $detail=null)
    {
        if (!empty($detail) && !empty($type)) {
            return self::EVENT[$event][$type][$detail];
        } elseif (!empty($type)) {
            return self::EVENT[$event][$type];
        } else {
            return self::EVENT[$event];
        }
    }
    
}
